package com.hdoit.ares.logical.cust.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.ibatis.type.Alias;
import org.springframework.util.StringUtils;

import com.tennetcn.common.message.ModelBase;
/**
 * @author      chenghuan
 * @email       
 * @createtime  2017年10月26日 16:10:34
 * @comment
 */
@Alias("customer")
@Entity
@Table(name="cust_customer")
public class Customer extends ModelBase implements Comparable<Customer>{


	//主键
    @Id
    @Column(name="id")
    private String id;

    //姓名
    @Column(name="username")
    private String username;

    //昵称
    @Column(name="nickname")
    private String nickname;

    //用户标识
    @Column(name="userIdentity")
    private int userIdentity;

    //证件类型
    @Column(name="idType")
    private String idType;

    //证件号码
    @Column(name="idCode")
    private String idCode;

    //性别
    @Column(name="sex")
    private String sex;

    //电话
    @Column(name="phone")
    private String phone;

    //邮箱
    @Column(name="email")
    private String email;

    //生日
    @Column(name="birthday")
    private Date birthday;
    
    
    //app的openId
    @Column(name="appOpenId")
    private String appOpenId;

    //婚姻关系
    @Column(name="marryRelation")
    private String marryRelation;

    //orgCode
    @Column(name="orgCode")
    private String orgCode;

    //介绍人
    @Column(name="referee")
    private String referee;
    
    //介绍人标识
    @Column(name="refereeIdentity")
    private int refereeIdentity;
    
    //介绍人id
    @Column(name="refereeId")
    private String refereeId;

    //地区
    @Column(name="region")
    private String region;

    //注册时间
    @Column(name="registDate")
    private Date registDate;

    //客户级别
    @Column(name="level")
    private String level;

    //图像地址
    @Column(name="picPath")
    private String picPath;

    //openId
    @Column(name="openId")
    private String openId;
    
    //unionId
    @Column(name="unionId")
    private String unionId;

    //是否实名认证
    @Column(name="autonym")
    private String autonym;
    
    //关注状态
    @Column(name="attentionStatus")
    private String attentionStatus;

    //关注时间
    @Column(name="attentionDate")
    private Date attentionDate;

    //取消关注时间
    @Column(name="cancelAttentionDate")
    private Date cancelAttentionDate;

    //密码
    @Column(name="password")
    private String password;

    //unionMark
    @Column(name="unionMark")
    private String unionMark;
    
    //产品链接的上级
    @Column(name="buyRefreeIdentity")
    private Integer buyRefreeIdentity;
    
    //加入初创时间
    @Column(name="joinMakerDate")
    private Date joinMakerDate;
    
    //加入高创时间
    @Column(name="joinHighMakerDate")
    private Date joinHighMakerDate;
    
    //修改地区时间
    @Column(name="updateRegionDate")
    private Date updateRegionDate;
    
    //注册会员填写的登录密码
    @Column(name="loginPassword")
    private String loginPassword;
  
	//注册会员的loginUnionMark
    @Column(name="loginUnionMark")
    private String loginUnionMark;
    
    //省份id
    @Column(name="provinceId")
    private String provinceId;
    
    //城市id
    @Column(name="cityId")
    private String cityId;
    
    
    //区县id
    @Column(name="districtId")
    private String districtId;
    
    
    @Column(name="honor")
    private String honor;
    
	@Transient
    private String linkname;
    
  /*  @Transient
    private AutonymApprove autonymApprove;*/
    
    @Transient
    private CustomerInfoMore customerInfoMore;
    
   
     
    //一代数量
    @Transient
    private int firstGeneration;
    
    //二代数量
    @Transient
    private int secondGeneration;
    
    //一代游客
    @Transient
    private int firstVisitor;
    
    //二代游客
    @Transient
    private int secondVisitor;
    
    //一代会员
    @Transient
    private int firstVip;
    
    //一代会员
    @Transient
    private int secondVip;
    
    //一代初创
    @Transient
    private int firstMaker;
    
    //二代初创
    @Transient
    private int secondMaker;
    
    //一代高创
    @Transient
    private int firstHighMaker;
    
    //二代高创
    @Transient
    private int secondHighMaker;
    
    //利润分配顺序位置
    @Transient
    private Integer sord;
    
    //利润分配百分比
    @Transient
    private Double tempPercentege;
    
    //利润分配百分比
    @Transient
    private Double promote;
    
    //利润分配百分比
    @Transient
    private Double firstShare;
    
    //利润分配百分比
    @Transient
    private Double secondShare;
    
    //利润分配百分比
    @Transient
    private Double server;
    
    //利润分配百分比
    @Transient
    private Double hatch;
    
    //某人某段时间的总奖励金豆
    @Transient
    private Double totalGoldBean;
    
    //某人某段时间的总奖励奖金
    @Transient
    private Double totalMoney;
    
    
    
    
    public String getProvinceId() {
		return provinceId;
	}
	public void setProvinceId(String provinceId) {
		this.provinceId = provinceId;
	}
	public String getCityId() {
		return cityId;
	}
	public void setCityId(String cityId) {
		this.cityId = cityId;
	}
	public String getDistrictId() {
		return districtId;
	}
	public void setDistrictId(String districtId) {
		this.districtId = districtId;
	}
	
	public Double getTempPercentege() {
		return tempPercentege;
	}
	public void setTempPercentege(Double tempPercentege) {
		this.tempPercentege = tempPercentege;
	}
	public Integer getSord() {
		return sord;
	}
	public void setSord(Integer sord) {
		this.sord = sord;
	}
/*	public AutonymApprove getAutonymApprove() {
		return autonymApprove;
	}
	public void setAutonymApprove(AutonymApprove autonymApprove) {
		this.autonymApprove = autonymApprove;
	}*/
	public CustomerInfoMore getCustomerInfoMore() {
		return customerInfoMore;
	}
	public void setCustomerInfoMore(CustomerInfoMore customerInfoMore) {
		this.customerInfoMore = customerInfoMore;
	}
	public int getFirstGeneration() {
		return firstGeneration;
	}
	public void setFirstGeneration(int firstGeneration) {
		this.firstGeneration = firstGeneration;
	}
	public int getSecondGeneration() {
		return secondGeneration;
	}
	public void setSecondGeneration(int secondGeneration) {
		this.secondGeneration = secondGeneration;
	}
	public int getFirstVisitor() {
		return firstVisitor;
	}
	public void setFirstVisitor(int firstVisitor) {
		this.firstVisitor = firstVisitor;
	}
	public int getFirstVip() {
		return firstVip;
	}
	public void setFirstVip(int firstVip) {
		this.firstVip = firstVip;
	}
	public int getSecondVip() {
		return secondVip;
	}
	public void setSecondVip(int secondVip) {
		this.secondVip = secondVip;
	}
	public int getFirstMaker() {
		return firstMaker;
	}
	public void setFirstMaker(int firstMaker) {
		this.firstMaker = firstMaker;
	}
	public int getSecondMaker() {
		return secondMaker;
	}
	public void setSecondMaker(int secondMaker) {
		this.secondMaker = secondMaker;
	}
	public int getFirstHighMaker() {
		return firstHighMaker;
	}
	public void setFirstHighMaker(int firstHighMaker) {
		this.firstHighMaker = firstHighMaker;
	}
	public int getSecondHighMaker() {
		return secondHighMaker;
	}
	public void setSecondHighMaker(int secondHighMaker) {
		this.secondHighMaker = secondHighMaker;
	}
	public String getId(){
        return this.id;
    }
    public void setId(String id){
         this.id=id;
    }

    public String getUsername(){
        return this.username;
    }
    public void setUsername(String username){
         this.username=username;
    }

    public String getNickname(){
        return this.nickname;
    }
    public void setNickname(String nickname){
         this.nickname=nickname;
    }

    public int getUserIdentity(){
        return this.userIdentity;
    }
    public void setUserIdentity(int userIdentity){
         this.userIdentity=userIdentity;
    }

    public String getIdType(){
        return this.idType;
    }
    public void setIdType(String idType){
         this.idType=idType;
    }

    public String getIdCode(){
        return this.idCode;
    }
    public void setIdCode(String idCode){
         this.idCode=idCode;
    }

    public String getSex(){
        return this.sex;
    }
    public void setSex(String sex){
         this.sex=sex;
    }

    public String getPhone(){
        return this.phone;
    }
    public void setPhone(String phone){
         this.phone=phone;
    }

    public String getEmail(){
        return this.email;
    }
    public void setEmail(String email){
         this.email=email;
    }

    public Date getBirthday(){
        return this.birthday;
    }
    public void setBirthday(Date birthday){
         this.birthday=birthday;
    }

    public String getMarryRelation(){
        return this.marryRelation;
    }
    public void setMarryRelation(String marryRelation){
         this.marryRelation=marryRelation;
    }

    public String getOrgCode(){
        return this.orgCode;
    }
    public void setOrgCode(String orgCode){
         this.orgCode=orgCode;
    }

    public String getReferee(){
        return this.referee;
    }
    public void setReferee(String referee){
         this.referee=referee;
    }

    public int getRefereeIdentity() {
		return refereeIdentity;
	}
	public void setRefereeIdentity(int refereeIdentity) {
		this.refereeIdentity = refereeIdentity;
	}
	
	public String getRefereeId() {
		return refereeId;
	}
	public void setRefereeId(String refereeId) {
		this.refereeId = refereeId;
	}
	
	public String getRegion(){
        return this.region;
    }
    public void setRegion(String region){
         this.region=region;
    }

    public Date getRegistDate(){
        return this.registDate;
    }
    public void setRegistDate(Date registDate){
         this.registDate=registDate;
    }

    public String getLevel(){
        return this.level;
    }
    public void setLevel(String level){
         this.level=level;
    }

    public String getPicPath(){
        return this.picPath;
    }
    public void setPicPath(String picPath){
         this.picPath=picPath;
    }

    public String getOpenId(){
        return this.openId;
    }
    public void setOpenId(String openId){
         this.openId=openId;
    }

    public String getUnionId() {
		return unionId;
	}
	public void setUnionId(String unionId) {
		this.unionId = unionId;
	}
	
	public String getAutonym(){
        return this.autonym;
    }
    public void setAutonym(String autonym){
         this.autonym=autonym;
    }

    public String getAttentionStatus(){
        return this.attentionStatus;
    }
    public void setAttentionStatus(String attentionStatus){
         this.attentionStatus=attentionStatus;
    }

    public Date getAttentionDate(){
        return this.attentionDate;
    }
    public void setAttentionDate(Date attentionDate){
         this.attentionDate=attentionDate;
    }

    public Date getCancelAttentionDate(){
        return this.cancelAttentionDate;
    }
    public void setCancelAttentionDate(Date cancelAttentionDate){
         this.cancelAttentionDate=cancelAttentionDate;
    }

    public String getPassword(){
        return this.password;
    }
    public void setPassword(String password){
         this.password=password;
    }

    public String getUnionMark(){
        return this.unionMark;
    }
    public void setUnionMark(String unionMark){
         this.unionMark=unionMark;
    }
	public int getSecondVisitor() {
		return secondVisitor;
	}
	public void setSecondVisitor(int secondVisitor) {
		this.secondVisitor = secondVisitor;
	}
	
	@Override
	public int compareTo(Customer o) {
		 return this.sord - o.getSord();
	}
	public Double getPromote() {
		return promote;
	}
	public void setPromote(Double promote) {
		this.promote = promote;
	}
	public Double getFirstShare() {
		return firstShare;
	}
	public void setFirstShare(Double firstShare) {
		this.firstShare = firstShare;
	}
	public Double getSecondShare() {
		return secondShare;
	}
	public void setSecondShare(Double secondShare) {
		this.secondShare = secondShare;
	}
	public Double getServer() {
		return server;
	}
	public void setServer(Double server) {
		this.server = server;
	}
	public Double getHatch() {
		return hatch;
	}
	public void setHatch(Double hatch) {
		this.hatch = hatch;
	}
	public Customer() {
		this.promote = 0.0;
		this.firstShare = 0.0;
		this.secondShare = 0.0;
		this.server = 0.0;
		this.hatch =0.0;
	}
	
	public String getLinkname() {
		if(StringUtils.isEmpty(this.getUsername())){
			return this.getNickname();
		}
		return this.getUsername();
	}
	public void setLinkname(String linkname) {
		this.linkname = linkname;
	}
	public Double getTotalGoldBean() {
		return totalGoldBean;
	}
	public void setTotalGoldBean(Double totalGoldBean) {
		this.totalGoldBean = totalGoldBean;
	}
	public Double getTotalMoney() {
		return totalMoney;
	}
	public void setTotalMoney(Double totalMoney) {
		this.totalMoney = totalMoney;
	}
	
	public Integer getBuyRefreeIdentity() {
		return buyRefreeIdentity;
	}
	public void setBuyRefreeIdentity(Integer buyRefreeIdentity) {
		this.buyRefreeIdentity = buyRefreeIdentity;
	}
	public Date getJoinMakerDate() {
		return joinMakerDate;
	}
	public void setJoinMakerDate(Date joinMakerDate) {
		this.joinMakerDate = joinMakerDate;
	}
	public Date getJoinHighMakerDate() {
		return joinHighMakerDate;
	}
	public void setJoinHighMakerDate(Date joinHighMakerDate) {
		this.joinHighMakerDate = joinHighMakerDate;
	}
	public Date getUpdateRegionDate() {
		return updateRegionDate;
	}
	public void setUpdateRegionDate(Date updateRegionDate) {
		this.updateRegionDate = updateRegionDate;
	}
	  
    public String getLoginPassword() {
		return loginPassword;
	}
	public void setLoginPassword(String loginPassword) {
		this.loginPassword = loginPassword;
	}
	public String getLoginUnionMark() {
		return loginUnionMark;
	}
	public void setLoginUnionMark(String loginUnionMark) {
		this.loginUnionMark = loginUnionMark;
	}
	public String getHonor() {
		return honor;
	}
	public void setHonor(String honor) {
		this.honor = honor;
	}
	public String getAppOpenId() {
		return appOpenId;
	}
	public void setAppOpenId(String appOpenId) {
		this.appOpenId = appOpenId;
	}
	
	

}
